/*
 * DefineEditText.h
 *
 *  Created on: 2011-7-22
 *      Author:
 */

#ifndef DEFINEEDITTEXT_H_
#define DEFINEEDITTEXT_H_
#include <tinyxml.h>
#include "type.h"
#include "Tag.h"
#include "Rect.h"
#include "RGBA.h"
namespace swfstream {

class DefineEditText: public swfstream::Tag {
public:
	DefineEditText();
	virtual ~DefineEditText();
	virtual TiXmlElement* toTiXmlElement();

	uint16 CharacterID; //  UI16 ID for this dynamic text	 character.
	Rect* Bounds; // Rectangle that completely	 encloses the text field.
	bool HasText; // UB[1] 0 = text field has no default text.	 1 = text field initially displays the string specified by InitialText.
	bool WordWrap; // UB[1] 0 = text will not wrap and will	 scroll sideways. 1 = text will wrap automatically when the end of line is reached.
	bool Multiline; // UB[1] 0 = text field is one line only. 1 = text field is multi-line and scrollable.
	bool Password; // UB[1] 0 = characters are displayed as typed. 1 = all characters are displayed as an asterisk.
	bool ReadOnly; // UB[1] 0 = text editing is enabled. 1 = text editing is disabled.
	bool HasTextColor; // UB[1] 0 = use default color. 1 = use specified color (TextColor).
	bool HasMaxLength; // UB[1] 0 = length of text is unlimited. 1 = maximum length of string is specified by MaxLength.
	bool HasFont; // UB[1] 0 = use default font. 1 = use specified font (FontID) and height (FontHeight). (Can’t be true if HasFontClass is true).
	bool HasFontClass; // UB[1] 0 = no fontClass, 1 = fontClass and Height specified for this text. (can't be true if HasFont is true). Supported in Flash Player 9.0.45.0 and later.
	bool AutoSize; // UB[1] 0 = fixed size.	 1 = sizes to content (SWF 6 or	 later only).
	bool HasLayout; // UB[1] Layout information provided.
	bool NoSelect; // UB[1] Enables or disables interactive text selection.
	bool Border; // UB[1] Causes a border to be drawn around the text field.
	bool WasStatic; // UB[1] 0 = Authored as dynamic text 1 = Authored as static text
	bool HTML; // UB[1] 0 = plaintext content. 1 = HTML content (see following).
	bool UseOutlines; // UB[1] 0 = use device font. 1 = use glyph font.
	uint16 FontID; // If HasFont, UI16 ID of font to use.
	char* FontClass; // If HasFontClass, STRING Class name of font to be loaded from another SWF and used for this text.
	uint16 FontHeight; // If HasFont, UI16 Height of font in twips.
	RGBA* TextColor; // If HasTextColor, RGBA Color of text.
	uint16 MaxLength; // If HasMaxLength, UI16 Text is restricted to this length.
	uint8 Align; // If HasLayout, UI8 0 = Left 	 1 = Right	 2 = Center	 3 = Justify
	uint16 LeftMargin; // If HasLayout, UI16 Left margin in twips.
	uint16 RightMargin; // If HasLayout, UI16 Right margin in twips.
	uint16 Indent; // If HasLayout, UI16 Indent in twips.
	int16 Leading; // If HasLayout, SI16 Leading in twips (vertical distance between bottom of descender of one line and top of ascender of the next).
	char* VariableName; // STRING Name of the variable where the contents of the text field are stored. May be qualified with dot syntax or slash syntax for non-global variables.
	char* InitialText; // If HasText STRING Text that is initially displayed.
	/*
	 *
	 * */
};

} /* namespace swfstream */
#endif /* DEFINEEDITTEXT_H_ */
